package com.aya.aop.asp;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
@Order(value = -10)
@Aspect
@Service
public class SecondAnnotationAop implements Ordered
{
    Logger logger = LoggerFactory.getLogger(ChildBean.class);

    @Around("args(name)")
    public Object doAround(ProceedingJoinPoint pjp, String name) throws Throwable {
        logger.info("SecondAnnotationAop:start");
        Object obj = pjp.proceed();
        logger.info("SecondAnnotationAop:end");
        return obj;
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
